package com.dzsw.javabase.file;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.stream.Stream;

public class ReadCsvSample {

    public static void main(String[] args) {
        String filePath = "C:\\Users\\SyDevuser36\\Downloads\\1.csv";
        Charset charset = Charset.forName("Windows-31J");

        try (Stream<String> lines = Files.lines(Paths.get(filePath), charset)) {
            lines.filter(line -> !line.isEmpty())
                    .forEach(line -> {
                        System.out.println(line);
                    });
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
